use super::solution::Solution;


impl Solution {
    pub fn min_rectangles_to_cover_points(mut points: Vec<Vec<i32>>, w: i32) -> i32 {
        points.sort_by_key(|item|{item[0]});
        let mut ans =0;
        let mut  next =-1;
        for p in points.into_iter() {
            let x=p[0];
            if x>next{
                ans+=1;
                next=x+w;
            }
        }
        ans
    }
}